<template>
  <div>
    <el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
    <eForm ref="form" :sup_this="sup_this" :is-add="false" :dicts="dicts"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    },
    dicts: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.getAllCpy()
      /* _this.form = {
        busMainData: {
          id: this.data.id,
          userName: this.data.userName,
          userAccount: this.data.userAccount,
          password: this.data.password,
          phone: this.data.phone,
          email: this.data.email,
          weixin: this.data.weixin,
          avatar: this.data.avatar,
          mainCpyCode: this.data.mainCpyCode,
          mainOrgCode: this.data.mainOrgCode,
          thirdAccount: this.data.thirdAccount,
          userStatus: this.data.userStatus,
          enableFlag: this.data.enableFlag,
          cpyVOS: []
        },
        busCommonState: {
          selfState: this.data.selfState,
          id: this.data.busId
        }
      }*/
      _this.viewMainData(this.data.id)
      _this.cpyCodes = []
      this.data.cpyVOS.forEach(function(data, index) {
        _this.cpyCodes.push(data.cpyCode)
      })
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
